import java.util.Scanner;

public class Ex3_28{
	public static void main(String[] args){
		Scanner input = new Scanner(System.in);
		System.out.print("Enter r1's center x- and y- coordinates, width, and height: ");
		double x1 = input.nextDouble();
		double y1 = input.nextDouble();
		double w1 = input.nextDouble();
		double h1 = input.nextDouble();
		System.out.print("Enter r2's center x- and y- coordinates, width, and height: ");
		double x2 = input.nextDouble();
		double y2 = input.nextDouble();
		double w2 = input.nextDouble();
		double h2 = input.nextDouble();

		double dx = Math.abs(x2 - x1);
		double dy = Math.abs(y2 - y1);
		boolean xin = dx + 0.5 * w2 <= 0.5 * w1;
		boolean yin = dy + 0.5 * h2 <= 0.5 * h1;
		boolean xol = dx - 0.5 * w2 <= 0.5 * w1;
		boolean yol = dy - 0.5 * h2 <= 0.5 * h1;
		if (xin && yin)
			System.out.println("r2 is inside r1.");
		else
			if (xol && yol)
				System.out.println("r2 overlaps r1");
			else
				System.out.println("r2 doest not overlap r1");
	}
}